<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="taglibs.jsp"%>
<%@ include file="RolePowerManager.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	
  <link rel="stylesheet" href="${ctx}/css/common.css" type="text/css"></link>
  <link rel="stylesheet" href="${ctx}/css/reset.css" type="text/css"></link>
  <link rel="stylesheet" href="${ctx}/css/Train/CertificateManager.css" type="text/css"></link>
  <link rel="stylesheet" href="${ctx}/css/Train/floatdiv.css" type="text/css"></link>
  
   <script type="text/javascript" src="${ctx}/js/jquery-1.7.2.js"></script>
  <script type="text/javascript" src="${ctx}/js/jquery.easydrag.handler.beta2.js"></script>
  <script type="text/javascript" src="${ctx}/js/My97DatePicker/WdatePicker.js"></script>
  <script type="text/javascript" src="${ctx}/js/Train/CertificateManager.js"></script>

  
<script type='text/javascript' src='${ctx}/dwr/engine.js'></script>
<script type='text/javascript' src='${ctx}/dwr/util.js'></script>
<script type='text/javascript' src='${ctx}/dwr/interface/dwrCertificateManager.js'></script>
  <script type='text/javascript' src='${ctx}/dwr/interface/GetEmpTrainManager.js'></script>
  </head>
  
  <body>
  	  <div class="head">
  		<div class="curloc"><span>当前位置:教育培训 >>员工证书记录</span></div>
  	  </div>
  	  <form action="FindCertificateServlet" method="post" id="searchform">
	  <div class="query">
	  <div class="querytype">
	  	<label>查询条件：</label>
	  	<select class="queryselect" name="serchtype" id="serchtype" onchange="changeserchtype()">
			<option value="empname">
			学员姓名
			</option>
			<option value="cername">
			证书名称
			</option>
			<option value="time">
			日期
			</option>
		</select>
		<input class="queryinput" type="text" id="inputtext" name="keycode"/>
	  </div>
	  <div class="querytime">
	  	<label >获证时间：</label>
	  	<div class="selecttime">
	  		<label>起始：<input type="text"  id="starttime" name="starttime" onClick="WdatePicker()" size="10"/> </label>
	  		<label>结束：<input type="text"  id="endtime" name="endtime" onClick="WdatePicker()" size="10"/> </label>
	  	</div>
	  	<div class="querybtn" onclick="search()" style="margin-left:10px;">
	  		<span class="STYLE1"><img src="${ctx}/images/a1.gif" width="9" height="9" /></span>
            <span class="STYLE1"> </span><a style="cursor: pointer;">查询</a><span class="STYLE1"></span>
	  	</div>
      </div>
       <div style="float: right; padding-right: 20px">
	  			<span class="STYLE1"><img src="${ctx}/images/001.gif" width="9" height="9" /></span>
            	<span class="STYLE1"> </span><a href="#" onclick="clickaddcer()">新增</a><span class="STYLE1"></span>
	  </div>
	  <div class="clear"> </div>
	  </div>
        </form>
        <div id="main">
        <table id="detail_t">
          <tr>
          	<th>序号</th>
            <th>学员姓名</th>
            <th>培训名称</th>
            <th>证书编号</th>
            <th>证书名称</th>
            <th>获证书日期</th>
            <th>有效日期</th>
            <th>工资调整</th>
            <th>更多操作</th>
          </tr>
            <c:forEach items="${page.list}" var="c" varStatus="status">
    	<tr>
    	<td>${status.count}</td>
    	<td>${c.emp.name}</td>
    	<td>${c.train.trainname}</td>
    	<td>${c.cerid}</td>
    	<td>${c.cername}</td>   	
    	<td>${c.cerdate}</td>
    	<td>${c.deadline}</td>
    	<td>${c.salflag?"是":"否"}</td>
    	<td>
    	<div align="center">
            <span class="STYLE1"><img src="${ctx}/images/037.gif" width="9" height="9" /></span>
            <span class="STYLE1"> [</span><a href="#" onclick="clickupdate('${c.id}')">详情/修改</a><span class="STYLE1">]</span>
            &nbsp;&nbsp;&nbsp;
            <span class="STYLE2"><img src="${ctx}/images/010.gif" width="9" height="9" /></span>
            <span class="STYLE2"> </span><span class="STYLE1">[</span><a href="#" onclick="deletecer('${c.id}')">删除</a><span class="STYLE1">]</span>
            </div>
    	</td>
    </tr>
    </c:forEach>
       
        </table>
			 <div class="manu">共${page.totalCount}条记录当前第<font color="#ff6600">${page.pageNo}/${page.pageCount}</font>页
				 <a href="FindCertificateServlet?pageNo=${1}">首页</a>
				  <a href="FindCertificateServlet?pageNo=${page.pageNo-1}">上一页</a>
				  <a href="FindCertificateServlet?pageNo=${page.pageNo+1}">下一页</a>
				  <a href="FindCertificateServlet?pageNo=${page.pageCount}">末页</a> 每页显示
				  <input type="text" name="pageSize"  id="pageSize" size="4"/>条
				  <input type="submit" value="提交" class="submitbuttton" onclick="changePageSize()"/> 
			</div>
		<div id="AddCertificate_div">
			<div class="div_head" id="AddCertificate_head">
				<span class="div_title">新增证书</span> <span><a
					class="div_close" onclick="hideDiv('AddCertificate_div');" title="close">X</a>
				</span>
			</div>
			
			<div id="AddCertificate_box_body">
				<div class="p_con">
				<form action="${ctx}/AddCertificateServlet" method="post" name="addform" id="addcerform">
					<table id="detail_t">
        	        	<tr>
        					<td>员工号：</td>
        					<td><input type="text" name="empno" id="empno" onblur="checkempno()">
        					<span id="empname" style="margin-left: 10px"></span>
        					</td>
        				</tr>
        				<tr>
        					<td>培训号：</td>
        					<td><input type="text" name="trainid" id="trainid" onblur="checktrainid()">
        					<span id="trainname" style="margin-left: 10px"></span>
        					</td>
        				</tr>
        				<tr>
        					<td>证书名：</td>
        					<td><input type="text" name="cername" id="cername"/></td>
        				</tr>
        				<tr>
        					<td>证书号：</td>
        					<td><input type="text" name="cerno" id="cerno"/></td>
        				</tr>
        				<tr>
        					<td>取证日期：</td>
        					<td>
        						<input type="text" name="cerdate" id="cerdate" onClick="WdatePicker()">
        					</td>
        				</tr>
        				<tr>
        					<td>证书有效期：</td>
        					<td>
        						<input type="text" name="dateline" id="dateline" onClick="WdatePicker()">
        					</td>
        				</tr>
        				<tr>
        					<td colspan="2">
        					<span style="float: right;margin-right: 30px">
        					<input type="reset" value="重置" class="submitbuttton">
        					<input type="button" value="增加" class="submitbuttton" onclick="addCertificate()">
        					</span>
        					</td>
        				</tr>
       				 </table>
       				 </form>
				</div>
			</div>
		</div>
		<div id="UpdateCertificate_div">
			<div id="UpdateCertificate_head" class="div_head">
				<span class="div_title">证书详情/修改</span> <span><a
					class="div_close" onclick="hideDiv('UpdateCertificate_div');" title="close">X</a>
				</span>
			</div>
			<div  id="UpdateCertificate_box_body">
				<div class="p_con">
				<form action="${ctx}/UpdateCertificateServlet" method="post" name="updateform" id="updateform">
					<table id="detail_t">
        	        	<tr>
        				<td>员工号<input type="hidden" id="upcerid" name="cerid"/></td>
        					<td><span id="upempno"></span></td>
        				</tr>
        				<tr>
        				<td>员工名</td>
        					<td><span id="upempname"></span></td>
        				</tr>
        				<tr>
        				<td>培训名</td>
        					<td><span id="uptrainname"></span></td>
        				</tr>
        				<tr>
        					<td>证书编号</td>
        					<td><input type="text" name="cername" id="upcername"></td>
        				</tr>
        				<tr>
        					<td>证书编号</td>
        					<td><input type="text" name="cerno" id="upcerno"></td>
        				</tr>
        					<tr>
        					<td>取证日期：</td>
        					<td>
        						<input type="text" name="cerdate" id="upcerdate" onClick="WdatePicker()">
        					</td>
        				</tr>
        				<tr>
        					<td>证书有效期：</td>
        					<td>
        						<input type="text" name="dateline" id="updateline" onClick="WdatePicker()">
        					</td>
        				</tr>
        				<tr>
        					<td>进行工资：</td>
        					<td>       						
        						<input type="radio" name="ifchangework" value="f" checked="checked"/>否
        						<input type="radio" name="ifchangework" value="t"/>是
        					</td>
        				</tr>
        				<tr>
        					<td>原工资：</td>
        					<td>
        						<span id="oldsalary"></span>
        					</td>
        				</tr>
        				
        				<tr>
        					<td>新工资：</td>
        					<td>
        						<input type="text" name="newsalary" id="newsalary">
        					</td>
        				</tr>
        				
        				<tr>
        				<td colspan="2">
        					<span style="float: right;margin-right: 30px">
        					<input type="reset" value="重置" class="submitbuttton">
        					<input type="button" value="修改" class="submitbuttton" onclick="updateCertificate()">
        					</span>
        					</td>
        				</tr>
       				 </table>
       				 </form>
				</div>
			</div>
		</div>
        
        	
  </body>
</html>